<div class="product product-view hasImg">
    <!--begin map-->
    <div class="map"><a class="index" href="/index">首页</a>&nbsp;&gt;&nbsp;
        <a href="/index/goods/index.html">商品列表</a>&nbsp;&gt;&nbsp;查看详情</div>
    <!--/end map-->

    <!--begin main-->
    <div class="main-t">

        <div class="fl w350" id="goodPreImgs">
            <div id="preview" class="spec-preview tc">
                <img src="https://resource.dinghuo123.com/images/product480x480.png" style="width: 350px; height: 350px;" alt="">
            </div>

        </div>
        <!--/GoodPreImgs-->
        <div class="product-detail-wrap pr">
            <div class="product-detail-title">
                <h1>{$row.cname} </h1>
                <div class="product-detail-code lite-gray">
                    <span>分类：{$row.cname}</span>
                    <span>编码：P3218048373</span>
                    <span>条形码：</span>
                </div>
            </div>

            <div class="product-detail-spec control-box ui-blue-choose pl20 mb20">
                <!-- 这里加入是否多单位的判断，显示多单位选项 -->
                <div class="lh30">
                    <!-- 没有启用多单位才显示计量单位 -->
                    <span class="mr20">计量单位：套</span>
                </div>
                <div class="product-tags lh30">
                    商品标签：<span class="tag-item">新品上架</span>
                </div>
                <div class="control-group buyCountWrap">
                    <span class="fl">购买数量：</span>
                    <div class="control-input">
                        <input type="text" class="ui-input w120 buyCount" id="number" value="">
                    </div>
                    <div class="" style="display: inline-block;margin-left: 15px;">
                    </div>&nbsp;
                    <input type="hidden" class="inventory_num" value="11138">
                </div>
            </div>

            <div class="product-detail-property control-box"></div>


            <div class="control-box product-detail-op ml20">
                <div class="control-group mb5">
                    <input type="hidden" class="hid_collectionId" value="">
                    <a href="javascript:void(0)" class="ui-btn ui-btn-lg ui-btn-theme mr10" id="addtocart" data-productid="198363094"><em class="ui-btn-goshopping"></em><span>加入购物车</span></a>
                    <!--<a href="javascript:void(0)" id="addtofav" class="ui-btn ui-btn-lg ui-btn-default w130 mr10" data-productid="198363094"><em class="ui-btn-addfav"></em><span>加入收藏</span></a>-->
                </div>
                <div class="control-group">

                </div>
            </div>

        </div>
        <div class="cb"></div>
        <div class="productInto">
            <ul class="ui-tab2-menu tabNav productintoNav">
                <li class=""><a href="javascript:void(0)">商品介绍</a></li>
            </ul>
            <div class="tabCon tabConitem product-desc" style="display: none;">
                <div>暂无商品介绍</div>
            </div>

        </div>

    </div>
    <!--/end main-->
</div>

<script>
    $(function () {
      var id = '{$row.id}';
      $('#addtocart').click(function () {
        var number = $('#number').val();
        if(number <= 0)
        {
          layer.msg('请输入购买数量！');
          return false;
        }
        $.ajax({
          type: "POST",
          url: "/index/goods/add",
          data: {id:id, number:number},
          dataType: "json",
          success: function(data){
            if(data.count)
            {
              $('.shoppingcartNum').html(data.count);
            }
            layer.msg(data.msg);
          }
        });
      });
    })
</script>